package entities;

import java.io.Serializable;

/**
 * @author Vodi
 * 
 * Class Ticket represent a request for a change in a system
 * It holds references for other classes, each represents a stage in a ticket's life cycle  
 */
public class Ticket implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long ticket_id;
	private InfoSystem is;
	private User ticketInitiator;
	private User inspector;
	private String status;
	private String state;
	private GeneralInformationStage generalInfo;
	private EvaluationReportStage evaluationReportStage;
	private ExecutionStage executionStage;
	private ReviewDecisionStage reviewDecisionStage;
	private VerificationStage verificationStage;
	private ClosureStage closureStage;
	
	public Ticket() {
	}

	public Long getTicket_id() {
		return ticket_id;
	}

	public void setTicket_id(Long ticket_id) {
		this.ticket_id = ticket_id;
	}

	public InfoSystem getInfoSystem() {
		return is;
	}

	public void setInfoSystem(InfoSystem is) {
		this.is = is;
	}

	/**
	 * Get the initiator of the current ticker
	 * @return User
	 */
	public User getTicketInitiator() {
		return ticketInitiator;
	}

	public void setUser(User ticketInitiator) {
		this.ticketInitiator = ticketInitiator;
	}

	/**
	 * Get the inspector of the current ticket
	 * @return User
	 */
	public User getInspector() {
		return inspector;
	}

	public void setInspector(User inspector) {
		this.inspector = inspector;
	}
	
	public EvaluationReportStage getEvaluationReportStage() {
		return evaluationReportStage;
	}

	public GeneralInformationStage getGeneralInfo() {
		return generalInfo;
	}

	public void setGeneralInfo(GeneralInformationStage generalInfo) {
		this.generalInfo = generalInfo;
	}

	public void setEvaluationReportStage(EvaluationReportStage evaluationReportStage) {
		this.evaluationReportStage = evaluationReportStage;
	}

	public ExecutionStage getExecutionStage() {
		return executionStage;
	}

	public void setExecutionStage(ExecutionStage executionStage) {
		this.executionStage = executionStage;
	}

	public ReviewDecisionStage getReviewDecisionStage() {
		return reviewDecisionStage;
	}

	public void setReviewDecisionStage(ReviewDecisionStage reviewDecisionStage) {
		this.reviewDecisionStage = reviewDecisionStage;
	}

	public VerificationStage getVerificationStage() {
		return verificationStage;
	}

	public void setVerificationStage(VerificationStage verificationStage) {
		this.verificationStage = verificationStage;
	}

	public ClosureStage getClosureStage() {
		return closureStage;
	}

	public void setClosureStage(ClosureStage closureStage) {
		this.closureStage = closureStage;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		if(status == null)
			this.status = "";
		else 
			this.status = status;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		if(state == null)
			this.state = "";
		else
			this.state = state;
	}
}
